const init = {
  num: 1,
};

const Message = (state = init, action = {}) => {
  switch (action.type) {
    case "MESSAGE_NUM":
      return { ...state, ...action.data };
    case "ALL_MESSAGE_NUM":
      return { ...state, ...action.data };
    case "READ_MESSAGE_NUM":
      return { ...state, ...action.data };
    case "ADD_MESSAGE_NUM":
      let temp = state;
      temp.num++;
      return { ...temp };
    default:
      return state;
  }
};
export default Message;
